home *** CD-ROM | disk | FTP | other *** search
/ Network CD 2 / Network CD - Volume 2.iso / programs / internet / develop / nsplib1_30.lha / NetSupportLibrary / doc / NetSupport.doc < prev   
Encoding:
Text File  |  1994-05-20  |  28.9 KB  |  878 lines

  1. TABLE OF CONTENTS
  2.  
  3. netsupport.library/AllocMemPooled
  4. netsupport.library/ExpungeResident
  5. netsupport.library/FreeMemPooled
  6. netsupport.library/GetConfig
  7. netsupport.library/GetConfigEntry
  8. netsupport.library/GetSeq
  9. netsupport.library/IsFileLocked
  10. netsupport.library/LoadResident
  11. netsupport.library/LockFile
  12. netsupport.library/LockFileAttempt
  13. netsupport.library/MakeLogEntry
  14. netsupport.library/PClose
  15. netsupport.library/POpen
  16. netsupport.library/SetConfigEntry
  17. netsupport.library/TempName
  18. netsupport.library/TempNameT
  19. netsupport.library/UnLockFile
  20. netsupport.library/UnLockFiles
  21. netsupport.library/AllocMemPooled           netsupport.library/AllocMemPooled
  22.  
  23.     NAME
  24.        AllocMemPooled -- allocate a block of memory out of the
  25.                libraries memory pool
  26.  
  27.     SYNOPSIS
  28.        memblock = AllocMemPooled(blocksize, attributes);
  29.        D0                        D0         D1
  30.  
  31.        void *  memblock;
  32.        ULONG   blocksize;
  33.        ULONG   attributes;
  34.  
  35.     FUNCTION
  36.        This routines allocates a memory block of the requested size
  37.        using the libraries internal memory pool. This is a big
  38.        advantage when several smaller allocations have to be made,
  39.        because memory pooling reduces fragmentation significantly.
  40.  
  41.        Using this routine you won't have to care about managing the
  42.        pool, the library will do for you. If the routine is started
  43.        under exec.library v39 or later, the exec pool routines will be
  44.        used. Under Kickstart 37, the library will handle the pool
  45.        itself.
  46.  
  47.     INPUTS
  48.        blocksize = this is the size the requested block in byte
  49.  
  50.        attributes = AllocMemPooled() understands exactly the same
  51.                attributes as the original exec routines. Please refer to
  52.                AllocMem() or exec/memory.h for further details.
  53.  
  54.     RESULT
  55.        The routine returns either the address of the allocated block or
  56.        NULL, if the routine failed due to low-memory condition.
  57.  
  58.     NOTE
  59.        The library tracks all allocations you do and frees them itself
  60.        when CloseLibrary() is called. However, it is strongly
  61.        recommended to free all memory IMMEDIATELY when it isn't needed
  62.        anymore. It is very bad programming style to rely on the library
  63.        freeing everything for you.
  64.  
  65.        If you're calling the routine in another process, you created
  66.        using CreateNewProc() or a similar routine, you MUST open the
  67.        library again! Do not just pass the LibraryBase to the new
  68.        process or you'll break the memory-tracking mechanism, either
  69.        causing loss of memory or even a complete system crash.
  70.  
  71.     SEE ALSO
  72.        FreeMemPooled()
  73.  
  74.  
  75. netsupport.library/ExpungeResident         netsupport.library/ExpungeResident
  76.  
  77.     NAME
  78.        ExpungeResident -- expunges all resident files and thus frees
  79.                memory
  80.  
  81.     SYNOPSIS
  82.        ExpungeResident(void);
  83.  
  84.     FUNCTION
  85.        This routine frees all allocated buffers and expunges all loaded
  86.        resident modules. This routine is usually called by the OS when
  87.        memory is lacking and should not be used by other programs.
  88.  
  89.     INPUTS
  90.        none
  91.  
  92.     RESULT
  93.        none
  94.  
  95.     SEE ALSO
  96.        LoadResident()
  97.  
  98. netsupport.library/FreeMemPooled             netsupport.library/FreeMemPooled
  99.  
  100.  
  101.     NAME
  102.        FreeMemPooled -- free a memory block previously allocated with
  103.                        AllocMemPooled()
  104.  
  105.     SYNOPSIS
  106.        success = FreeMemPooled(memblock);
  107.        D0                      A1
  108.  
  109.        LONG    success;
  110.        void *  memblock;
  111.  
  112.     FUNCTION
  113.        This routines frees a memory block, allocated with AllocMemPooled()
  114.        earlier. Just the address is required, the library keeps track
  115.        of the blocksizes itself.
  116.  
  117.     INPUTS
  118.        memblock = pointer the the memory block
  119.  
  120.     RESULT
  121.        Either -1L for success or 0L for failure.
  122.  
  123.     NOTE
  124.        The memory allocation tracking mechanism will catch an attempt
  125.        to free a memory block twice. However, please do NOT rely on
  126.        this feature!
  127.  
  128.     SEE ALSO
  129.        AllocMemPooled()
  130.  
  131.  
  132. netsupport.library/GetConfig                     netsupport.library/GetConfig
  133.  
  134.     NAME
  135.        GetConfig -- return a configuration entry or system variable
  136.  
  137.     SYNOPSIS
  138.        entry = GetConfig(filename, keyword, dosvarname, default);
  139.        D0                A0        A1       A2          A3
  140.  
  141.        STRPTR  entry;
  142.        STRPTR  filename;
  143.        STRPTR  keyword;
  144.        STRPTR  dosvarname;
  145.        STRPTR  default;
  146.  
  147.     FUNCTION
  148.        GetConfig() does pretty much the same as GetConfigEntry(),
  149.        except that this routine is able to recognize local and global
  150.        DOS variables.
  151.  
  152.  
  153.     INPUTS
  154.        filename - Pointer to a string, containing the path and filename
  155.                to access the configfile in case no variable is set.
  156.  
  157.                When <filename> is NULL, the routine uses the configfile,
  158.                you specified as 'MasterConfig' in the library's own
  159.                configfile. The default is 'UULib:Config'.
  160.  
  161.        keyword - Pointer to a keyword string. All comparisons are
  162.                case-independent!
  163.  
  164.        dosvarname - pointer to a name of the local shell- and global
  165.                enviroment variable to check. When this parameter is
  166.                NULL, <keyword> is used. However, some purposes may
  167.                require a different variable name than config file
  168.                keyword.
  169.  
  170.        default - pointer to a string containing the default parameter,
  171.                which is returned in case, the keyword can't be found.
  172.  
  173.     RESULT
  174.        GetConfig() returns a pointer to a static buffer, holding the
  175.        provided parameter. Please take note that the contents of this
  176.        buffer is lost, when GetConfig() or GetConfigEntry() is called
  177.        the next time. You MUST not free or modify this library-internal
  178.        buffer!
  179.  
  180.        If no config entry matching your keyword was available, the
  181.        provided default is returned.
  182.  
  183.     NOTE
  184.        GetConfig() does NOT lock the file in order to avoid deadlocks.
  185.  
  186.     SEE ALSO
  187.        GetConfigEntry(), ParseConfigFile()
  188.  
  189. netsupport.library/GetConfigEntry           netsupport.library/GetConfigEntry
  190.  
  191.  
  192.     NAME
  193.        GetConfigEntry -- return a configuration entry
  194.  
  195.     SYNOPSIS
  196.        entry = GetConfigEntry(filename, keyword, default);
  197.        D0                     A0        A1       A2
  198.  
  199.        STRPTR  entry;
  200.        STRPTR  filename;
  201.        STRPTR  keyword;
  202.        STRPTR  default;
  203.  
  204.     FUNCTION
  205.        This routine is designed to replace the old Dillon UUCP config
  206.        routines and to perform some simple configuration issues.
  207.  
  208.        It checks if the provided keyword is available as local or
  209.        global system variable and eventually returned its contents. If
  210.        such a variable isn't set, it loads specified configfile and
  211.        searches for the keyword, returning the specified parameter.
  212.  
  213.     INPUTS
  214.        filename - Pointer to a string, containing the path and filename
  215.                to access the configfile in case no variable is set.
  216.  
  217.                When <filename> is NULL, the routine uses the configfile,
  218.                you specified as 'MasterConfig' in the library's own
  219.                configfile. The default is 'UULib:Config'.
  220.  
  221.        keyword - Pointer to a keyword string. All comparisons are
  222.                case-independent!
  223.  
  224.        default - pointer to a string containing the default parameter,
  225.                which is returned in case, the keyword can't be found.
  226.  
  227.     RESULT
  228.        GetConfigEntry() returns a pointer to a static buffer, holding
  229.        the provided parameter. Please take note that the contents of
  230.        this buffer is lost, when GetConfigEntry() or GetConfig() is
  231.        called the next time. You MUST not free or modify this
  232.        library-internal buffer!
  233.  
  234.        If no config entry matching your keyword was available, the
  235.        provided default is returned.
  236.  
  237.     NOTE
  238.        GetConfigEntry() does NOT lock the file in order to avoid
  239.        deadlocks.
  240.  
  241.     CONFIGFILE SYNTAX
  242.        A valid config file may contain one keyword per line. Keywords
  243.        MUST begin at the first column. The parameter can be separated
  244.        from the keyword using either space(s) or tab(s).
  245.  
  246.        GetConfigEntry() skips all leading blanks or tabs until the
  247.        first "non-blank" character. Then it returns the whole line
  248.        until the return, truncating any blanks or tabs at the end of
  249.        the line.
  250.  
  251.        Lines starting with a '#' are commentlines and will be ignored.
  252.  
  253.  
  254.        Example:
  255.                KEYWORD parameter
  256.                FOO     bar
  257.                # comment
  258.                FO   " O  B A R "
  259.  
  260.        GetConfigEntry does not parse the parameter and therefore does
  261.        NOT remove the double-quotes '"' in the last line!
  262.  
  263.     SEE ALSO
  264.        GetConfig(), ParseConfigFile()
  265.  
  266. netsupport.library/GetSeq                           netsupport.library/GetSeq
  267.  
  268.    NAME
  269.        GetSeq -- get a sequential, unique number
  270.  
  271.    SYNOPSIS
  272.        number = GetSeq(bump)
  273.        D0              D0
  274.  
  275.        ULONG   number;
  276.        ULONG   bump;
  277.  
  278.    FUNCTION
  279.        GetSeq() returns a number which is guaranteed to be unique.
  280.        Despite the internal numbers used by TempName(), this number is
  281.        still unique when the library was closed and flushed or the machine
  282.        has been switched off.
  283.  
  284.        Obviously, this requires the number to be saved on disk.
  285.  
  286.    INPUTS
  287.        bump - The returned number is sequential. >bump< is the value that
  288.                        is added to the current value. Using bump, you
  289.                        can obtain (allocate) several numbers with one
  290.                        call--reducing the number of necessary disk
  291.                        accesses.
  292.  
  293.    RESULT
  294.        GetSeq() returns the current value of the counter and writes the
  295.        increased counter back to disk.
  296.  
  297.    NOTE
  298.        GetSeq(0L) returns the current value, but does NOT increase the
  299.        counter!
  300.  
  301.        The file that holds the current seq-counter can be configured in
  302.        the library configfile. Please do never change this value manually
  303.        unless you know what you do.
  304.  
  305.    EXAMPLE
  306.        The current counter is, say, 500. Now you call:
  307.  
  308.                num = GetSeq(4);
  309.  
  310.        num will have the value of 501. Additionally, you have the right
  311.        to use the numbers 502, 503 and 504, because you specified a bump
  312.        of 4.
  313.  
  314.    SEE ALSO
  315.  
  316. netsupport.library/IsFileLocked               netsupport.library/IsFileLocked
  317.  
  318.     NAME
  319.        IsFileLocked -- returns the (lock-)status of a file
  320.  
  321.     SYNOPSIS
  322.        boolean = IsFileLocked(filename);
  323.        D0                     A0
  324.  
  325.        LONG    boolean;
  326.        STRPTR  filename;
  327.  
  328.     BACKGROUND
  329.        Please refer to LockFile() for a brief description.
  330.  
  331.     FUNCTION
  332.        Sometimes you want to know wether a file is locked or not,
  333.        without actually getting the exclusive access on the file--so
  334.        this is the routine to use.
  335.  
  336.     INPUTS
  337.        filename - Pointer to a string, containing the path and filename
  338.                to access the file.
  339.  
  340.     RESULT
  341.        IsFileLocked() returns either ZERO (0L) for an unlocked file,
  342.        any positive value for 'file is locked' or a negative value for
  343.        indicating an error.
  344.  
  345.     NOTE
  346.        Lockfile() is able to recognize, if the same file is accessed
  347.        using two different paths, like "SYS:file" / "WB_2.x:file" for
  348.        example. This is archived using the system call SameLock().
  349.        However, due to this feature, LockFile() has to store the DOS
  350.        lock of an already locked file, meaning that the file has to
  351.        be created if it doesn't exist already.
  352.  
  353.     SEE ALSO
  354.        LockFile(), LockFileAttempt()
  355.  
  356. netsupport.library/LoadResident               netsupport.library/LoadResident
  357.  
  358.     NAME
  359.        LoadResident -- loads a file and stores it resident, to buffer
  360.                further access
  361.  
  362.     SYNOPSIS
  363.        buffer = LoadResident(filename)
  364.        D0                    A0
  365.  
  366.        STRPTR  buffer;
  367.        STRPTR  filename;
  368.  
  369.     FUNCTION
  370.        This routine loads the specified file and stores it in an
  371.        internal resident list. The next time this file is accessed,
  372.        the buffer will be returned immediately without disk access.
  373.  
  374.        The routine tests wether the file on disk is newer than the
  375.        resident version and re-loads it in case it is.
  376.  
  377.     INPUTS
  378.        filename - name and path of the file that should be loaded
  379.  
  380.     RESULT
  381.        If the file couldn't be loaded for any reason, NULL is returned.
  382.        Otherwise the routine returns a pointer to the buffer holding the
  383.        file. The length of the file is returned by IoErr(). You must not
  384.        modify or free the returned buffer!
  385.  
  386.     NOTE
  387.        The routine does NOT lock the file using LockFile()!
  388.        The loaded file is always null terminated and thus can be used
  389.        with string routines.
  390.  
  391.     SEE ALSO
  392.        ExpungeResident()
  393.  
  394. netsupport.library/LockFile                       netsupport.library/LockFile
  395.  
  396.     NAME
  397.        LockFile -- lock a file before actually accessing it
  398.  
  399.     SYNOPSIS
  400.        success = LockFile(filename);
  401.        D0                 A0
  402.  
  403.        LONG    success;
  404.        STRPTR  filename;
  405.  
  406.     BACKGROUND
  407.        In a multitasking enviroment, like the Amiga is, it is important
  408.        to coordinate and syncronize the usage of the available
  409.        resources. This includes devices, memory and, of course, files.
  410.        What happens, if your program needs a certain config file, while
  411.        another program is reading/writing the file? You're attempt will
  412.        fail, the access will be denied. Now things become difficult.
  413.  
  414.        Say, you just noticed that a file access failed. What should you
  415.        do? Maybe the file is free in a few seconds, maybe you can do
  416.        some other things while waiting for the file to become
  417.        available.
  418.  
  419.        Using the libraries locking mechanism solves many problems for
  420.        you. Most packages have recognized this problem and use some
  421.        rather strange file locking mechanism, like Dillon UUCP 1.15.
  422.        or the OwnDevUnit.Library for this purpose. Well, these
  423.        mechanism had several disadvantages: They were not really
  424.        designed for files!
  425.  
  426.        Both of them were not able to recognize that "UUMAIL:foobar" and
  427.        "UUCP:Mail/foobar" is the same file! And if you'd just used the
  428.        filenames without paths (what many authors did to come around
  429.        the above problem), a lock to "UUMAIL:foobar" would fail if
  430.        "ARCHIVE:foobar" was locked. All this problems are gone with
  431.        LockFile().
  432.  
  433.        Forget about all this pseudo-names like "LOG-UPDATE.LOCK" and
  434.        similar names, lock the complete filename, including path!
  435.        LockFile() can handle all those situations, using SameLock() to
  436.        determine of the same file is access with two different paths.
  437.  
  438.        Remember: Use the same filename to lock the file, you use for
  439.        the actual Open() call, or the mechanism will break!
  440.  
  441.     FUNCTION
  442.        LockFile() determines the complete path to the file you
  443.        specified and tests wether this file is locked by some other
  444.        process and eventually waits for the file to become available.
  445.  
  446.        UnLockFile() has to be called when the file isn't required
  447.        anymore.
  448.  
  449.     INPUTS
  450.        filename - Pointer to a string, containing the path and filename
  451.                to access the file.
  452.  
  453.     RESULT
  454.        LockFile() returns TRUE if the file could be locked
  455.        successfully. If an error occurs, FALSE will be returned.
  456.  
  457.     SEE ALSO
  458.        LockFileAttempt(), IsFileLocked(), UnLockFile(), UnLockFiles()
  459.  
  460. netsupport.library/LockFileAttempt         netsupport.library/LockFileAttempt
  461.  
  462.     NAME
  463.        LockFileAttempt -- try to lock a file
  464.  
  465.     SYNOPSIS
  466.        success = LockFileAttempt(filename);
  467.        D0                        A0
  468.  
  469.        LONG    success;
  470.        STRPTR  filename;
  471.  
  472.     FUNCTION
  473.        LockFileAttempt() does mainly the same as LockFile(). The only
  474.        difference is, that LockFileAttempt() does not wait for the file
  475.        to become available, but returns immediately.
  476.  
  477.        If the locking attempt was successful, UnLockFile() has to be
  478.        called when the file isn't required anymore.
  479.  
  480.     INPUTS
  481.        filename - Pointer to a string, containing the path and filename
  482.                to access the file.
  483.  
  484.     RESULT
  485.        LockFile() returns TRUE if the file could be locked
  486.        successfully. If an error occurred, or the file is locked
  487.        already, FALSE is returned.
  488.  
  489.     NOTE
  490.        Lockfile() is able to recognize, if the same file is accessed
  491.        using two different paths, like "SYS:file" / "WB_2.x:file" for
  492.        example. This is archived using the system call SameLock().
  493.        However, due to this feature, LockFile() has to store the DOS
  494.        lock of an already locked file, meaning that the file has to
  495.        be created if it doesn't exist already.
  496.  
  497.     SEE ALSO
  498.        LockFile(), IsFileLocked(), UnLockFile(), UnLockFiles()
  499.  
  500.  
  501. netsupport.library/MakeLogEntry               netsupport.library/MakeLogEntry
  502.  
  503.  
  504.     NAME
  505.        MakeLogEntry -- generates an entry in the appropriate logfile
  506.  
  507.     SYNOPSIS
  508.        MakeLogEntry(system, class, logmessage, ...)
  509.                     A0      D0     A1          A2
  510.  
  511.        STRPTR  system;
  512.        ULONG   class;
  513.        STRPTR  logmessage;
  514.  
  515.     FUNCTION
  516.        This routine determines the appropriate logfile for an entry,
  517.        using the specified system and class parameters (please refer to
  518.        the libraries user manual for further information). Then it
  519.        locks this file and writes the logmessage into it, prefaced with
  520.        the current date and time.
  521.  
  522.     INPUTS
  523.        system - Pointer to a string, specifying the 'system', making the
  524.                log entry. The system should be a short, descriptive
  525.                name for your program, maybe the package it belongs to.
  526.                The user can use the system name to direct the log-entries
  527.                to certain logfiles, so better be verbose. :-)
  528.                You should document the system name your program uses!
  529.                If NULL is specified, the log-entry goes into the
  530.                default logfile. If no default is specified, "T:Logfile"
  531.                is used.
  532.  
  533.        class - value, describing the kind of the logmessage
  534.  
  535.        logmessage - pointer to a string containing the actual message
  536.                text. Please refer to RawDoFmt() for usage.
  537.  
  538.     RESULT
  539.        none
  540.  
  541.     CLASSES
  542.        MLE_DEFAULT - This class is used if no special class can be
  543.                determined (0L). This makes it easier to port older
  544.                sources to the new routine--however, this entry should
  545.                be avoided.
  546.  
  547.        MLE_INFO - This class should be used for plain information logs,
  548.                what happened to what time.
  549.  
  550.        MLE_DEBUG[1-9] - This class should be used for debugging output.
  551.                The number following the actual name is the debug level
  552.                of the log-entry. MLE_DEBUG9, for example, is a rather
  553.                unimportant debug message, while MLE_DEBUG0 is rather
  554.                elementary and important to find bugs.
  555.  
  556.        MLE_ERROR - This class should be used to log occurring non-fatal
  557.                errors.
  558.  
  559.        MLE_FATAL_ERROR - This class should be used to log fatal errors.
  560.                Fatal errors are very important and usually need
  561.                immediate fixing. So be careful using this class.
  562.  
  563.     EXAMPLE ENTRY
  564.        (10-Nov-93/13:04:18) UUCP, Sending mail to foo@bar.UUCP
  565.        (10-Nov-93/13:04:56) TCP/IP, Connected wuarchive.wust.edu
  566.        (10-Nov-93/13:05:01) TCP/IP, Starting FTP request for foobar.lha
  567.  
  568.     NOTE
  569.  
  570.     SEE ALSO
  571.        RawDoFmt()
  572.  
  573. netsupport.library/PClose                           netsupport.library/PClose
  574.  
  575.     NAME
  576.        PClose -- closes a pipe previously opened with POpen()
  577.  
  578.     SYNOPSIS
  579.        returncode = PClose(fh);
  580.        D0                  d0
  581.  
  582.        LONG    returncode;
  583.        BPTR    fh;
  584.  
  585.     FUNCTION
  586.        This routine closes a pipe previously created with POpen() and
  587.        returns the returncode of the executed command.
  588.  
  589.     INPUTS
  590.        fh = filehandle returned by POpen()
  591.  
  592.     RESULT
  593.        Code returned by the executed command.
  594.  
  595.     BUGS
  596.        Until NetSupport.Library version 1.27, PClose() did not catch the
  597.        returncode of the executed program. This has been fixed.
  598.  
  599.     SEE ALSO
  600.        POpen()
  601.  
  602. netsupport.library/POpen                             netsupport.library/POpen
  603.  
  604.     NAME
  605.        POpen -- starts a command and redirects its input stream to a
  606.                pipe, whose file handle is returned.
  607.  
  608.     SYNOPSIS
  609.        fh = POpen(command, mode);
  610.        D0         A0       D0
  611.  
  612.        BPTR    fh;
  613.        STRPTR  command;
  614.        LONG    mode;
  615.  
  616.     FUNCTION
  617.        This is an equivalent of the UNIX popen() routine, designed for
  618.        AmigaOS. POpen() is usually used to start an external program
  619.        that expects data from the input stream or provides data via the
  620.        output stream. The command is started asynchrony, of course.
  621.  
  622.     INPUTS
  623.        command = String with the command to be started. The command
  624.                should not contain any i/o redirectors like "<file",
  625.                although it will work. Additionally, you should not
  626.                start a command via POpen("run ...", MODE_PIPETO) either.
  627.  
  628.        mode = This is the mode the pipe should be opened in. MODE_PIPETO
  629.                will start the command to read from the pipe and
  630.                MODE_PIPEFROM will start the command with its output re-
  631.                directed to the returned pipe-handle.
  632.  
  633.     RESULT
  634.        The routine returns the file handle of the opened pipe, which you
  635.        can use for either reading or writing, depending on the mode you
  636.        opened the pipe with. If an error occurs, NULL will be returned.
  637.  
  638.     EXAMPLE
  639.        The following code will send some dummy letter to the postmaster
  640.        of your UUCP/inet site:
  641.  
  642.                BPTR fh;
  643.                STRPTR sendmail = GetConfig(NULL, SENDMAIL, NULL, SENDMAIL);
  644.  
  645.                if (fh = POpen(sendmail, MODE_PIPETO)) {
  646.                    FPrintf(fh, "To: postmaster\nSubject: Bug report\n\n");
  647.                    FPuts(fh, "Sorry to bother you, but error #1 occurred\n);
  648.                    PClose(fh);
  649.                }
  650.  
  651.  
  652.     SEE ALSO
  653.        PClose()
  654.  
  655.  
  656. netsupport.library/SetConfigEntry           netsupport.library/SetConfigEntry
  657.  
  658.  
  659.     NAME
  660.        SetConfigEntry -- set a configuration entry
  661.  
  662.     SYNOPSIS
  663.        success = SetConfigEntry(filename, keyword, parameter);
  664.        D0                       A0        A1       A2
  665.  
  666.        LONG    success;
  667.        STRPTR  filename;
  668.        STRPTR  keyword;
  669.        STRPTR  parameter;
  670.  
  671.     FUNCTION
  672.        This routine can be used to set a certain entry in a config
  673.        file. SetConfigEntry() will load the file and look for the
  674.        specified keyword. If the keyword can be found, it will replace
  675.        the parameter with the provided one and write the file back.
  676.  
  677.        When the keyword couldn't be found, SetConfigEntry() will append
  678.        the keyword plus parameter at the end of the file.
  679.  
  680.        Please read GetConfigEntry() for a brief description of the
  681.        configfile format.
  682.  
  683.     INPUTS
  684.        filename - Pointer to a string, containing the path and filename
  685.                to access the configfile in case no variable is set.
  686.  
  687.                When <filename> is NULL, the routine uses the configfile,
  688.                you specified as 'MasterConfig' in the library's own
  689.                configfile. The default is 'UULib:Config'.
  690.  
  691.        keyword - Pointer to a keyword string. All comparisons are
  692.                case-independent!
  693.  
  694.        parameter - pointer to a string containing the parameter to be
  695.                set behind the keyword in the configfile.
  696.  
  697.     RESULT
  698.        SetConfigEntry() either TRUE (!0L) or FALSE (0L) for success/
  699.        failure.
  700.  
  701.     NOTE
  702.        The specified configfile MUST at least exist or the routine will
  703.        fail!
  704.  
  705.        SetConfigEntry() does NOT lock the file in order to avoid
  706.        deadlocks.
  707.  
  708.     SEE ALSO
  709.        GetConfigEntry(), GetConfig()
  710.  
  711. netsupport.library/TempName                       netsupport.library/TempName
  712.  
  713.    NAME
  714.        TempName -- build an unique temporary filename
  715.  
  716.    SYNOPSIS
  717.        tmpname = TempName(buffer);
  718.        D0                 A0
  719.  
  720.        STRPTR tmpname;
  721.        STRPTR buffer;
  722.  
  723.    FUNCTION
  724.        TempName() builds an unique filename you can use for your
  725.        temporary files.
  726.  
  727.    INPUTS
  728.        buffer - Pointer to an buffer to hold the filename. The
  729.                        generated filename will not succeed 12
  730.                        characters. If NULL is specified, TempName()
  731.                        will use an internal buffer and return a pointer
  732.                        to this one. Please take note, that the internal
  733.                        buffer will be overwritten the next time you
  734.                        call TempName(), so copying its contents might be
  735.                        a good idea.
  736.  
  737.    RESULT
  738.        The returned result is a pointer to a buffer holding the name of
  739.        the unique filename. The filename will look like this:
  740.        "tmpXXXXXXXX", where the 'X-part' will be a hexadecimal number
  741.        like "tmp0000a214", for example.
  742.  
  743.        If an error occurs (out of memory), NULL will be returned. If
  744.        you provide the buffer, the routine CANNOT fail!
  745.  
  746.    NOTES
  747.        These filenames are meant for temporary files and you should use
  748.        them only for temporary ones. The number part (which make the
  749.        name unique) will be flushed to zero, every time the library is
  750.        removed from memory. If you want to generate unique filenames
  751.        which won't be overwritten after your program terminates, use
  752.        GetSeq() and similar routines to build the filename.
  753.  
  754.        If you want the filename to contain the "T:" path for temporary
  755.        files, call TempNameT(), which will result in "T:tmpXXXXXXXX".
  756.  
  757.    EXAMPLE
  758.        Though it doesn't really matter, you might want to place the
  759.        temporary files in certain directories or let them reflect the
  760.        program, they belong to. This can be archives as follows:
  761.  
  762.                char tmpname[32];
  763.  
  764.                strcpy(tmpname, "SYS:foobar_");
  765.                strcat(tmpname, TempName(NULL));
  766.  
  767.        This code will generate a filename like "SYS:foobar_tmp00000001".
  768.  
  769.    SEE ALSO
  770.        TempNameT(), GetSeq()
  771.  
  772. netsupport.library/TempNameT                     netsupport.library/TempNameT
  773.  
  774.    NAME
  775.        TempNameT -- build an unique temporary filename including path
  776.  
  777.    SYNOPSIS
  778.        tmpname = TempNameT(buffer);
  779.        D0                 A0
  780.  
  781.        STRPTR tmpname;
  782.        STRPTR buffer;
  783.  
  784.    FUNCTION
  785.        TempNameT() builds an unique path and filename you can use for
  786.        your temporary files.
  787.  
  788.    INPUTS
  789.        buffer - Pointer to an buffer to hold the filename. The
  790.                        generated filename will not succeed 14
  791.                        characters. If NULL is specified, TempNameT()
  792.                        will use an internal buffer and return a pointer
  793.                        to this one. Please take note, that the internal
  794.                        buffer will be overwritten the next time you
  795.                        call TempNameT(), so copying its contents might
  796.                        be a good idea.
  797.  
  798.    RESULT
  799.        The returned result is a pointer to a buffer holding the name of
  800.        the unique filename. The filename will look like this:
  801.        "T:tmpXXXXXXXX", where the 'X-part' will be a hexadecimal number
  802.        like "T:tmp0000a214", for example.
  803.  
  804.        If an error occurs (out of memory), NULL will be returned. If
  805.        you provide the buffer, the routine CANNOT fail!
  806.  
  807.    NOTES
  808.        These filenames are meant for temporary files and you should use
  809.        them only for temporary ones. The number part (which make the
  810.        name unique) will be flushed to zero, every time the library is
  811.        removed from memory. If you want to generate unique filenames
  812.        which won't be overwritten after your program terminates, use
  813.        GetSeq() and similar routines to build the filename.
  814.  
  815.    EXAMPLE
  816.        Though it doesn't really matter, you might the filename to
  817.        reflect the program, it belongs to:
  818.  
  819.                char tmpname[32];
  820.  
  821.                strcpy(tmpname, TempNameT(NULL));
  822.                strcat(tmpname, ".foobar");
  823.  
  824.        This code will generate a filename like "T:tmp00000001.foobar".
  825.  
  826.    SEE ALSO
  827.        TempName(), GetSeq()
  828.  
  829. netsupport.library/UnLockFile                   netsupport.library/UnLockFile
  830.  
  831.     NAME
  832.        UnLockFile -- free an previously locked file
  833.  
  834.     SYNOPSIS
  835.        UnLockFile(filename);
  836.                   A0
  837.  
  838.        STRPTR  filename;
  839.  
  840.     FUNCTION
  841.        UnLockFile() releases a lock on a file, previously obtained
  842.        using LockFile().
  843.  
  844.     INPUTS
  845.        filename - Pointer to a string, containing the path and filename
  846.                to access the file.
  847.  
  848.     RESULT
  849.        none
  850.  
  851.     SEE ALSO
  852.        LockFile(), LockFileAttempt(), UnLockFiles()
  853.  
  854. netsupport.library/UnLockFiles                 netsupport.library/UnLockFiles
  855.  
  856.     NAME
  857.        UnLockFiles -- free all files locked by a process
  858.  
  859.     SYNOPSIS
  860.        UnLockFiles();
  861.  
  862.     BACKGROUND
  863.        Please refer to LockFile() for a brief description.
  864.  
  865.     FUNCTION
  866.        UnLockFiles() releases all filelocks obtained the by calling
  867.        process. This can be useful in error situations.
  868.  
  869.     INPUTS
  870.        none
  871.  
  872.     RESULT
  873.        none
  874.  
  875.     SEE ALSO
  876.        LockFile(), LockFileAttempt(), UnLockFile()
  877.  
  878.